<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<style>
    body {
        border: 1px solid #999;
        padding: 200px 0;
    }

    .demo {
        border: 1px solid red;
        background-color: aqua;
        height: 100px;
        width: 100px;
        display: inline-block;
        margin-right: 20px;
    }

    .demo:hover {
        background-color: maroon;
        color: white;
    }

    .translate_d:hover {
        transform: translate(5px, 10px);
        -ms-transform: translate(5px, 10px);
        /* IE 9 */
        -moz-transform: translate(5px, 10px);
        /* Firefox */
        -webkit-transform: translate(5px, 10px);
        /* Safari and Chrome */
        -o-transform: translate(5px, 10px);
        /* Opera */
    }

    .rotate_d:hover {
        transform: rotate(30deg);
        -ms-transform: rotate(30deg);
        /* IE 9 */
        -moz-transform: rotate(30deg);
        /* Firefox */
        -webkit-transform: rotate(30deg);
        /* Safari and Chrome */
        -o-transform: rotate(30deg);
        /* Opera */
    }

    .rotateX_d:hover {
        transform: rotateX(180deg);
        -ms-transform: rotateX(180deg);
        /* IE 9 */
        -moz-transform: rotateX(180deg);
        /* Firefox */
        -webkit-transform: rotateX(180deg);
        /* Safari and Chrome */
        -o-transform: rotateX(180deg);
        /* Opera */
    }

    .rotateY_d:hover {
        transform: rotateY(180deg);
        -ms-transform: rotateY(180deg);
        /* IE 9 */
        -moz-transform: rotateY(180deg);
        /* Firefox */
        -webkit-transform: rotateY(180deg);
        /* Safari and Chrome */
        -o-transform: rotateY(180deg);
        /* Opera */
    }

    .scale_d:hover {
        transform: scale(2, 4);
        -ms-transform: scale(2, 4);
        /* IE 9 */
        -moz-transform: scale(2, 4);
        /* Firefox */
        -webkit-transform: scale(2, 2);
        /* Safari and Chrome */
        -o-transform: scale(2, 4);
        /* Opera */
    }

    .skew_d:hover {
        transform: skew(30deg, 20deg);
        -ms-transform: skew(30deg, 20deg);
        /* IE 9 */
        -moz-transform: skew(30deg, 20deg);
        /* Firefox */
        -webkit-transform: skew(30deg, 20deg);
        /* Safari and Chrome */
        -o-transform: skew(30deg, 20deg);
        /* Opera */
    }

    #div1,#div1_2{
        position: relative;
        height: 200px;
        width: 200px;
        margin: 100px;
        padding: 10px;
        border: 1px solid black;
    }

    #div2,#div2_2 {
        padding: 50px;
        position: absolute;
        border: 1px solid black;
        background-color: red;
       
    }

    #div2:hover{
        transform: rotateY(180deg);
        transform-style: preserve-3d;
        -webkit-transform: rotateY(180deg);
        /* Safari and Chrome */
        -webkit-transform-style:preserve-3d;
        /* Safari and Chrome */
    }
    #div2_2:hover{
        transform: rotateY(180deg);
        transform-style: flat;
        -webkit-transform: rotateY(180deg);
        /* Safari and Chrome */
        -webkit-transform-style:flat;
        /* Safari and Chrome */
    }
    #div3,#div3_2{
        padding: 40px;
        position: absolute;
        transform: rotateY(180deg);
        -webkit-transform: rotateY(60deg);
        /* Safari and Chrome */
        border: 1px solid black;
        background-color: yellow;
    }
</style>

<body>
    <span>translate 移动</span>
    <div class="demo translate_d">
        此处用来测试
    </div>
    <span>rotate 旋转</span>
    <div class="demo rotate_d">
        此处用来测试
    </div>
    <span>scale 缩放扩大</span>
    <div class="demo scale_d">
        此处用来测试
    </div>
    <span>skew 翻转</span>
    <div class="demo skew_d">
        此处用来测试
    </div>
    <span>rotateX 3d向x轴翻转</span>
    <div class="demo rotateX_d">
        此处用来测试
    </div>
    <hr>
    <span>rotateY 3d向Y轴翻转</span>
    <div class="demo rotateY_d">
        此处用来测试
    </div>

    <div id="div1">
        <span>transforms-style 使被转换的子元素保留其 3D 转换：</span>
        <div id="div2">div22222
            <div id="div3">div33333</div>
        </div>
    </div>

    <div id="div1_2">
        <span>transforms-style 使被转换的子元素不保留其 3D 转换：</span>
        <div id="div2_2">div22222
            <div id="div3_2">div33333</div>
        </div>
    </div>

</body>

</html>